<template>
    <div class="customInfo">
        <div class="title">订单信息</div>
        <div>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    订单编号
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="orderInfo.code" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    业务员
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="orderInfo.customer" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    业务部门
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="orderInfo.customUnit" :disabled="disabled"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    订单编号：
                    <label class="text">{{orderInfo.code}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    业务员：
                    <label class="text">{{orderInfo.customer}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    业务部门：
                    <label class="text">{{orderInfo.customUnit}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    经销商
                </el-col>
                <el-col :span="5">
                    <el-autocomplete class="info-input" :fetch-suggestions="querySearchDealer" v-model="orderInfo.dealer" icon="search"></el-autocomplete>
                </el-col>
                <el-col :span="3" class="subTitle">
                    业务来源
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="orderInfo.serviceSource" placeholder="请选择">
                        <el-option v-for="item in $store.state.serviceSource" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    经销商：
                    <label class="text">{{orderInfo.dealer}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    业务来源：
                    <label class="text">{{orderInfo.serviceSource_name}}</label>
                </el-col>
            </el-row>
        </div>
        <div class="title">个人信息</div>
        <div>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    姓名
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.name" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    身份证地址
                </el-col>
                <el-col :span="13">
                    <el-input class="info-input" v-model="personalInfo.identityAddress"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    姓名：
                    <label class="text">{{personalInfo.name}}</label>
                </el-col>
                <el-col :span="13" class="info-label">
                    身份证地址：
                    <label class="text">{{personalInfo.identityAddress}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    身份证号
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.identityCode" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    身份证归属地
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.identityCounty" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    出生日期
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.age" :disabled="disabled"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    身份证号：
                    <label class="text">{{personalInfo.identityCode}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    身份证归属地：
                    <label class="text">{{personalInfo.identityCounty}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    出生日期：
                    <label class="text">{{personalInfo.age}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    性别
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" :disabled="disabled" v-model="personalInfo.sex" placeholder="请选择">
                        <el-option v-for="item in $store.state.sex" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    学历
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="personalInfo.education" placeholder="请选择">
                        <el-option v-for="item in $store.state.education" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    户籍
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.residence"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    性别：
                    <label class="text">{{personalInfo.sex_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    学历：
                    <label class="text">{{personalInfo.education_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    户籍：
                    <label class="text">{{personalInfo.residence}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    手机号码
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" :maxlength='11' v-model="personalInfo.phone"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    手机归属地
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="personalInfo.phoneAddress" :disabled="disabled"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    婚姻状态
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="personalInfo.marry" placeholder="请选择" :disabled="disabled">
                        <el-option v-for="item in $store.state.marryStatus" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    手机号码：
                    <label class="text">{{personalInfo.phone}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    手机归属地：
                    <label class="text">{{personalInfo.phoneAddress}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    婚姻状态：
                    <label class="text">{{personalInfo.marry_name}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    现住地址
                </el-col>
                <el-col :span="13">
                    <el-input class="info-input" v-model="personalInfo.address"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="13" class="info-label">
                    现住地址：
                    <label class="text">{{personalInfo.address}}</label>
                </el-col>
            </el-row>
        </div>
        <div class="title">单位信息</div>
        <div>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    单位名称
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="unitInfo.name"></el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    单位地址
                </el-col>
                <el-col :span="13">
                    <el-input class="info-input" v-model="unitInfo.address"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    单位名称：
                    <label class="text">{{unitInfo.name}}</label>
                </el-col>
                <el-col :span="13" class="info-label">
                    单位地址：
                    <label class="text">{{unitInfo.address}}</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    单位类别
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="unitInfo.type">
                        <el-option v-for="item in $store.state.unitType" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    职位
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="unitInfo.job">
                        <el-option v-for="item in $store.state.job" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    月收入
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="unitInfo.priceMoney">
                        <template slot="append">元</template>
                    </el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    单位类别：
                    <label class="text">{{unitInfo.type_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    职位：
                    <label class="text">{{unitInfo.job_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    月收入：
                    <label class="text">{{unitInfo.priceMoney}}元</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    工龄
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="unitInfo.seniority">
                        <el-option v-for="item in $store.state.seniority" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    单位电话
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="unitInfo.phone">
                    </el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    工龄：
                    <label class="text">{{unitInfo.seniority_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    单位电话：
                    <label class="text">{{unitInfo.phone}}</label>
                </el-col>
            </el-row>
        </div>
        <div class="title">房产信息</div>
        <div>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    房产所有人
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="houseInfo.owner">
                    </el-input>
                </el-col>
                <el-col :span="3" class="subTitle">
                    与购车人关系
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="houseInfo.link">
                        <el-option v-for="item in $store.state.link" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    房屋面积
                </el-col>
                <el-col :span="5">
                    <el-input class="info-input" v-model="houseInfo.space" type="number">
                    </el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    房产所有人：
                    <label class="text">{{houseInfo.owner}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    与购车人关系：
                    <label class="text">{{houseInfo.link_name}}</label>
                </el-col>
                <el-col :span="8" class="info-label">
                    房屋面积：
                    <label class="text">{{houseInfo.space}}㎡</label>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col :span="3" class="subTitle">
                    房屋性质
                </el-col>
                <el-col :span="5">
                    <el-select class="info-select" v-model="houseInfo.type">
                        <el-option v-for="item in $store.state.houseType" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span="3" class="subTitle">
                    房产地址
                </el-col>
                <el-col :span="13">
                    <el-input class="info-input" v-model="houseInfo.address">
                    </el-input>
                </el-col>
            </el-row>
            <el-row class="info-row" v-show="isEdit == false">
                <el-col :span="8" class="info-label">
                    房屋性质：
                    <label class="text">{{houseInfo.type_name}}</label>
                </el-col>
                <el-col :span="13" class="info-label">
                    房产地址：
                    <label class="text">{{houseInfo.address}}</label>
                </el-col>
            </el-row>
        </div>
        <div class="title">紧急联系人</div>
        <div>
            <div v-for="(vm , index) in dangerLinks.persons">
                <el-row class="info-row" v-show="isEdit == true">
                    <el-col :span="3" class="subTitle">
                        紧急联系人{{index+1}}
                    </el-col>
                    <el-col :span="5">
                        <el-input class="info-input" v-model="vm.name">
                        </el-input>
                    </el-col>
                    <el-col :span="3" class="subTitle">
                        与购车人关系
                    </el-col>
                    <el-col :span="5">
                        <el-select class="info-select" v-model="vm.link">
                            <el-option v-for="item in $store.state.linkOther" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-col>
                    <el-col :span="3" class="subTitle">
                        联系电话
                    </el-col>
                    <el-col :span="5">
                        <el-input class="info-input" :maxlength='11' v-model="vm.phone">
                        </el-input>
                    </el-col>
                </el-row>
                <el-row class="info-row" v-show="isEdit == false">
                    <el-col :span="8" class="info-label">
                        紧急联系人{{index+1}}：
                        <label class="text">{{vm.name}}</label>
                    </el-col>
                    <el-col :span="8" class="info-label">
                        与购车人关系：
                        <label class="text">{{vm.link_name}}</label>
                    </el-col>
                    <el-col :span="8" class="info-label">
                        联系电话：
                        <label class="text">{{vm.phone}}</label>
                    </el-col>
                </el-row>
            </div>
            <el-row class="info-row" v-show="isEdit == true">
                <el-col class="subTitle" :span="3">备注</el-col>
                <el-col :span="21">
                    <el-input class="info-textarea" :rows="3" type="textarea" placeholder="请输入" v-model="dangerLinks.desc"></el-input>
                </el-col>
            </el-row>
            <el-row class="info-row resultShrink" v-show="isEdit == false">
                <el-col class="subtitle" :span="3">备　　注</el-col>
                <el-col :span="12" class="text-height text-height-shrink" id='dangerLinks'>
                    {{ dangerLinks.desc }}
                </el-col>
                <el-col :span="3">
                    <el-button class="credit-button-text" type="text" @click="$libs.changeHeight('dangerLinks', dangerLinks)">{{ dangerLinks.shrinkText}}</el-button>
                </el-col>
            </el-row>
        </div>
    </div>
</template>
<script>
export default {
    name: 'customInfo',
    data() {
        return {
            isEdit: false,
            disabled: true,
            id: '',
            orderInfo: {
                code: '',
                customer: '',
                customUnit: '',
                dealer: '',
                serviceSource: '',
                serviceSource_name: '',
            },
            personalInfo: {
                name: '',
                identityAddress: '',
                identityCode: '',
                identityCounty: '',
                age: '',
                sex: '',
                sex_name: '',
                education: '',
                education_name: '',
                residence: '',
                phone: '',
                phoneAddress: '',
                marry: '',
                marry_name: '',
                address: ''
            },
            unitInfo: {
                name: '',
                address: '',
                type: '',
                type_name: '',
                job: '',
                job_name: '',
                priceMoney: '',
                seniority: '',
                seniority_name: '',
                phone: ''
            },
            houseInfo: {
                owner: '',
                link: '',
                link_name: '',
                space: '',
                type: '',
                type_name: '',
                address: ''
            },
            dangerLinks: {
                persons: [],
                desc: '',
                shrink: false,
                shrinkText: '展开全部'
            },
            querySearchDealerCb: ''
        }
    },
    watch: {
        'personalInfo.phone': function(_cur, _old) {
            if (_cur) {
                this.$libs.getPhoneAddress(_cur, _old, this, 'personalInfo.phoneAddress');
            }
        },
        'personalInfo.identityCode': function(_cur, _old) {
            if (_cur && _cur.length >= 18) {
                this.personalInfo.age = _cur.substring(6, 10) + '-' + _cur.substring(10, 12) + '-' + _cur.substring(12, 14)
            }
        },
        'houseInfo.space': function(_cur, _old) {
            if (_cur && _cur.length > 10000) {
                this.$message.error('房屋面积不能超过10000平米');
                this.houseInfo.space = 0;
            }
        },
        'orderInfo.dealer': function(_cur, _old) {
            if (_cur) {
                this.querySearchDealer(_cur, this.querySearchDealerCb);
            }
        },
        deep: true
    },
    methods: {
        querySearchDealer(queryString, cb) {
            if (!this.querySearchDealerCb) {
                this.querySearchDealerCb = cb;
            }
            let that = this;
            this.$store.commit('dealer', {
                this: that,
                key: this.orderInfo.dealer,
                cb: () => {
                    if (cb) {
                        cb(that.$store.state.dealer);
                        that.orderInfo.dealerId = that.$libs.jsonGetName(that.$store.state.dealer, queryString);
                    }
                }
            });
        },
        getUserInfo(_id) {
            this.$http.get('/order/customerInfo/' + _id).then((data) => {
                if (data.data.success) {
                    let datas = data.data.data;
                    this.orderInfo = {
                        code: datas.orderInfo.orderNo,
                        customer: datas.orderInfo.staffName,
                        customUnit: datas.orderInfo.deptName,
                        dealer: datas.orderInfo.dealerName,
                        dealerId: datas.orderInfo.dealerId,
                        serviceSource: this.$libs.toInt(datas.orderInfo.bizChannel),
                        serviceSource_name: this.$libs.jsonGetName(this.$store.state.serviceSource, datas.orderInfo.bizChannel),
                    };
                    this.personalInfo = {
                        name: datas.customer.customerName,
                        identityAddress: datas.customer.idCardAddr,
                        identityCode: datas.customer.idCard,
                        identityCounty: datas.customer.idCardLocation,
                        age: datas.customer.idCard.substring(6, 10) + '-' + datas.customer.idCard.substring(10, 12) + '-' + datas.customer.idCard.substring(12, 14),
                        sex: this.$libs.toInt(datas.customer.sex),
                        sex_name: this.$libs.jsonGetName(this.$store.state.sex, datas.customer.sex),
                        education: this.$libs.toInt(datas.customer.education),
                        education_name: this.$libs.jsonGetName(this.$store.state.education, datas.customer.education),
                        residence: datas.customer.census,
                        phone: datas.customer.mobilePhone,
                        phoneAddress: datas.customer.mobilePhoneLocation,
                        marry: this.$libs.toInt(datas.customer.bemarried),
                        marry_name: this.$libs.jsonGetName(this.$store.state.marryStatus, datas.customer.bemarried),
                        address: datas.customer.residentialAddr,
                        customerId: datas.customer.customerId
                    };
                    this.unitInfo = {
                        name: datas.customer.orgName,
                        address: datas.customer.orgAddr,
                        type: this.$libs.toInt(datas.customer.orgType),
                        type_name: this.$libs.jsonGetName(this.$store.state.unitType, datas.customer.orgType),
                        job: this.$libs.toInt(datas.customer.job),
                        job_name: this.$libs.jsonGetName(this.$store.state.job, datas.customer.job),
                        priceMoney: datas.customer.monthIncome,
                        seniority: this.$libs.toInt(datas.customer.workAge),
                        seniority_name: this.$libs.jsonGetName(this.$store.state.seniority, datas.customer.workAge),
                        phone: datas.customer.orgTel
                    };
                    this.houseInfo = {
                        owner: datas.houseInfo.houseOwner,
                        link: this.$libs.toInt(datas.houseInfo.relationship),
                        link_name: this.$libs.jsonGetName(this.$store.state.link, datas.houseInfo.relationship),
                        space: datas.houseInfo.houseArea,
                        type: this.$libs.toInt(datas.houseInfo.houseType),
                        type_name: this.$libs.jsonGetName(this.$store.state.houseType, datas.houseInfo.houseType),
                        address: datas.houseInfo.houseAddr,
                        customerId: datas.customer.customerId,
                        houseId: datas.houseInfo.houseId,
                    };
                    let dangerLinksPerson = [];
                    for (let i = 0; i < datas.emergencyContacts.length; i++) {
                        let el = datas.emergencyContacts[i];
                        dangerLinksPerson.push({
                            name: el.name,
                            link: this.$libs.toInt(el.relationship),
                            link_name: this.$libs.jsonGetName(this.$store.state.linkOther, el.relationship),
                            phone: el.mobilephone,
                            customerId: datas.customer.customerId,
                            emergencyContactId: el.emergencyContactId,
                        });
                    }
                    this.dangerLinks = {
                        persons: dangerLinksPerson,
                        desc: datas.customer.remark,
                        shrink: false,
                        shrinkText: '展开全部'
                    };
                    if (this.isEdit == true && this.dangerLinks.persons.length == 0) {
                        for (var i = 0; i < 2; i++) {
                            this.dangerLinks.persons.push({
                                name: '',
                                link: '',
                                phone: '',
                                customerId: '',
                                emergencyContactId: '',
                            });
                        }

                    }
                    console.log('param');
                    console.log(this);
                }
            }).catch((error) => {

            });
        },
        userInfoEnter(_id, _isMust, _orderStatus, _cb) {
            let that = this,
                emergencyContacts = [],
                isCheckPhone = true;
            $.each(this.dangerLinks.persons, function(i, val) {
                if (val.phone && parseInt(val.phone).toString().length != 11) {
                    isCheckPhone = false;
                    return;
                }
                emergencyContacts.push({
                    mobilephone: val.phone,
                    name: val.name,
                    orderNo: _id,
                    relationship: val.link,
                    // customerId: val.customerId,
                    // emergencyContactId: val.emergencyContactId
                });
            });
            if (!isCheckPhone) {
                this.$message.error('紧急联系人手机号码格式有误！');
                if (_cb) {
                    _cb();
                }
                return;
            }
            if (this.personalInfo.phone && parseInt(this.personalInfo.phone).toString().length != 11) {
                this.$message.error('客户信息手机号码格式有误！');
                if (_cb) {
                    _cb();
                }
                return;
            }
            if (this.orderInfo.dealer && this.orderInfo.dealerId == '') {
                this.$message.error('经销商选择有误！');
                if (_cb) {
                    _cb();
                }
                return;
            }
            let param = {
                customer: {
                    bemarried: this.personalInfo.marry,
                    census: this.personalInfo.residence,
                    customerName: this.personalInfo.name,
                    education: this.personalInfo.education,
                    idCard: this.personalInfo.identityCode,
                    idCardAddr: this.personalInfo.identityAddress,
                    idCardLocation: this.personalInfo.identityCounty,
                    job: this.unitInfo.job,
                    mobilePhone: this.personalInfo.phone,
                    mobilePhoneLocation: this.personalInfo.phoneAddress,
                    monthIncome: this.unitInfo.priceMoney,
                    orgAddr: this.unitInfo.address,
                    orgName: this.unitInfo.name,
                    orgTel: this.unitInfo.phone,
                    orgType: this.unitInfo.type,
                    residentialAddr: this.personalInfo.address,
                    sex: this.personalInfo.sex,
                    staffId: this.$store.state.staffId,
                    workAge: this.unitInfo.seniority,
                    customerId: this.personalInfo.customerId,
                    remark: this.dangerLinks.desc
                },
                emergencyContacts: emergencyContacts,
                houseInfo: {
                    customerId: this.houseInfo.customerId,
                    houseAddr: this.houseInfo.address,
                    houseArea: this.houseInfo.space,
                    // houseId: this.houseInfo.houseId,
                    houseOwner: this.houseInfo.owner,
                    houseType: this.houseInfo.type,
                    relationship: this.houseInfo.link,
                },
                orderInfo: {
                    bizChannel: this.orderInfo.serviceSource,
                    // "customerId": this.orderInfo.link,
                    dealerId: this.orderInfo.dealerId,
                    dealerName: this.orderInfo.dealer,
                    // deptId: this.orderInfo.customUnit,
                    deptName: this.orderInfo.customUnit,
                    // "loanBankName": this.orderInfo.link,
                    // "orderId":this.orderInfo.link,
                    orderNo: _id,
                    // orderStatus: this.orderInfo.link,
                    staffId: this.$store.state.staffId,
                    staffName: this.orderInfo.customer,
                    // "terminalType": this.orderInfo.link,
                }
            };
            console.log($('input'));
            if (_isMust && !this.$libs.mustWrite(param, ['customer.remark'])) {
                this.$store.commit('isAllMustFalse');
                if (_cb) {
                    _cb();
                }
                this.$libs.noneAddHightBorder();
                return;
            } else if (_isMust) {
                // this.$store.commit('isAllMustTrue');
                console.log('must' + 1);
            }
            if (this.houseInfo.houseId) {
                param.houseInfo.houseId = this.houseInfo.houseId;
            }
            $.each(this.dangerLinks.persons, function(i, val) {
                if (val.customerId) {
                    param.emergencyContacts[i].customerId = val.customerId;
                }
                if (val.emergencyContactId) {
                    param.emergencyContacts[i].emergencyContactId = val.emergencyContactId;
                }
            });
            this.$http.post('/order/customerInfo/' + _id, param).then((data) => {
                console.log(data);
                if (data.data.success) {
                    this.id = _id;
                    this.orderStatus = _orderStatus;
                    this.$store.commit('saveNumAdd', this, _id);
                } else {
                    this.$message.error(data.data.message);
                }
            }).catch((error) => {

            });
        }
    },
    mounted() {
        this.$store.commit('serviceSource', this);
        this.$store.commit('education', this);
        this.$store.commit('unitType', this);
        this.$store.commit('seniority', this);
        this.$store.commit('job', this);
        this.$store.commit('link', this);
        this.$store.commit('houseType', this);
        this.$store.commit('linkOther', this);
    }
}

</script>
<style lang="scss" scoped>
@import '../../assets/css/site.scss';
.customInfo {
    font-size: 14px;
    color: #475669;
    padding-top: 17px;
}

</style>
